package com.jsyh.maidu.adapter.home;

import android.content.Context;
import android.support.v7.widget.LinearLayoutManager;
import android.view.View;
import android.widget.ImageView;

import com.jsyh.maidu.R;
import com.jsyh.maidu.adapter.BetterRecyclerAdapter;
import com.jsyh.maidu.config.ConfigValue;
import com.jsyh.maidu.model.Ads;
import com.jsyh.maidu.model.BestNewHot;
import com.jsyh.maidu.views.BetterRecyclerView;
import com.squareup.picasso.Picasso;

import java.util.List;

/**
 * Created by Administrator on 2017/6/8.
 * 新品上市，热销商品，家用电器的ViewHolder
 */

public class ComprehensiveHolder extends MyBaseViewHolder {

    private BetterRecyclerView bestList;
    private BetterRecyclerAdapter adapter;

    private ImageView ad5;

    public ComprehensiveHolder(View itemView, Ads ad_5, Context context, List<BestNewHot> datas) {
        super(itemView);

        ad5 = (ImageView) itemView.findViewById(R.id.news_img);
        bestList = (BetterRecyclerView) itemView.findViewById(R.id.news_list);
        adapter = new BetterRecyclerAdapter(datas, context);
        LinearLayoutManager layoutManager = new LinearLayoutManager(context);
        layoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
        bestList.setLayoutManager(layoutManager);
        bestList.setAdapter(adapter);
        Picasso.with(context).load(ConfigValue.IMG_IP + ad_5.getImage()).into(ad5);

    }

    @Override
    public void bindData() {


    }

}
